<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<title>详情</title>
<%@ include file="/WEB-INF/jsp/common/inc.jsp" %>
<script type="text/javascript" src="${_resources}jquery-ui/jquery-ui-1.10.4.custom.min.js"></script>
<link rel="stylesheet" href="${_resources}jquery-ui/jquery-ui-1.10.4.custom.min.css" />
<script type="text/javascript">
$(function(){
	//默认点击第一个
	$("#ul>li:visible:first >a").click();
});

var roleId = "${roleId}";
var status = "${status}";
/* 展示详情界面 */
function showDetail(evl){
	changeCSS(evl);
	var div = document.getElementById("detail");
	div.src ="${_baseUrl}/role/showRoleInfo?roleId=" + roleId+"&random="+Math.random();
}

/* 角色成员 */
function showUserByRoleId(evl){
	if("" != roleId){
		changeCSS(evl);
		var div = document.getElementById("detail");
		div.src ="${_baseUrl}/role/showUserByRoleId?roleId=" + roleId+"&random="+Math.random();
	}else{
		layer.msg("请先保存角色信息");
	}
}
/* 授权管理 */
function showAccredit(evl){
	if("" != roleId){
		changeCSS(evl);
		var div = document.getElementById("detail");
		div.src ="${_baseUrl}/role/showNewAccredit?roleId="+ roleId+"&status="+status+"&random="+Math.random();
	}else{
		layer.msg("请先保存角色信息");
	}
}

function changeCSS(evl){
	var a = document.getElementsByTagName("a");
	for(var i in a){
		if(a[i].nodeName=="A"){
			a[i].removeAttribute("class");
		}
	}
	evl.setAttribute("class","qxsz_on");
}

function closeWin(){
	parent.closeWin();
}

function setRoleId(id){
	roleId = id;
}

function refreshTable(){
	parent.refreshTable();
}

function click(id){
	$("#"+id).click();
}

</script>
<style type="text/css">
body{overflow: hidden;}
.nav_ul li a{display:inline-block;width:100%;height:30px;line-height:30px}
.page_1200{overflow: hidden;}
.nav_ul{width:100%}
</style>
</head>
<body>
    <div class="submenu">
    	<ul id="ul" class="nav_ul ofo" style="overflow: hidden;margin-top:10px">
        	<li style="width:15%;margin-left:1%;" name='menu_a' class='navicon_on_a'><a href="javascript:;" id='icon1_b' class="qxsz_on" onclick="showDetail(this)">角色属性</a></li>
            <li style="width:15%" name='menu_a'><a href="javascript:;" onclick="showUserByRoleId(this)" id="roleUserList" >角色成员</a></li>
            <li style="width:15%" name='menu_a'><a href="javascript:;" onclick="showAccredit(this)">权限设置</a></li>
             <li style="width:53%"></li>
        </ul>
    </div>
    <div id='iframeCont' class='iframeCont'>
		<iframe id="detail" style="width:100%;" border="0" frameborder="0" src=""></iframe>
	</div>
</body>
<script type="text/javascript">
    window.onload=function(){
    	navStatus();
        initHeight()
    }
    
    $(window).on('resize', function () {initHeight()})
    
    function navStatus(){
        var oNav = $(".nav_ul li[name='menu_a']"),oIfr = $('.contIframe');
        document.getElementById('icon1_b').click();
        oNav.each(function(){
            $(this).click(function(){
                $(this).removeClass("navicon_on_a").addClass("navicon_on_a");
                oNav.not($(this)).removeClass('navicon_on_a');
            });
        });
    };

    function initHeight(){
    	var topH = $('.submenu').height();       
        if(navigator.userAgent.indexOf("MSIE")>0 || navigator.userAgent.indexOf("like Gecko")>0) {//IE浏览器
            initheight = document.documentElement.clientHeight-topH-10;
        }
        if(navigator.userAgent.indexOf("Firefox")>0){//Firefox浏览器
            initheight = document.documentElement.clientHeight-topH-10;
        }
        if(navigator.userAgent.indexOf("Opera")>0){//Opera浏览器
            initheight = document.body.clientHeight-topH;
        }
        if(navigator.userAgent.indexOf("Chrome")>0){//Chrome谷歌浏览器
        	$('html').css("height","100%");
        	$('body').css("height","100%");
            initheight = document.documentElement.clientHeight-topH-10;
        }
        $("#iframeCont").css("height",initheight);
    };

</script>
</html>